.TH E1432_SEND_TRIGGER 3 E1432
.SH NAME
e1432_send_trigger \- Send trigger from master to slave modules
.IX e1432_send_trigger(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_send_trigger(E1432ID hw, SHORTSIZ16 groupID) 
.cE
.SH DESCRIPTION
\fIe1432_send_trigger\fR gets the data FIFO index of a trigger from the
master module and passes it on to all the slave modules
in the RPM arming/trigger mode in a multi-module system.  
This is used to allow the module with the tach board to be the master module,
providing a trigger to all other modules in the system.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIgroupID\fR is the ID of a group of modules that was obtained with a
call to \fIe1432_create_channel_group\fR. 

The master module with the tach board in the group
must have been enabled by a call to \fIe1432_set_trigger_master\fR.  
This call puts all other modules in the group into slave mode.
Each time the master module 
notices a trigger in the RPM arming/trigger mode, the data FIFO index of the
trigger is saved and the \fBE1432_IRQ_TRIGGER\fR bit is set in the
\fBE142_IRQ_STATUS2_REG\fR register.  This bit can used to enable an interrupt
or can be polled by the host computer.  This scheme only works when the
data mode has been set to \fBE1432_DATA_MODE_OVERLAP_BLOCK\fR by a call to
\fIe1432_set_data_mode\fR.  The following fragment of code illustrates how
to poll for a master trigger and pass it on to the slaves.

.cS
    /* <masterChan> is a channel in the master module, <groupID> is a group
     * ID that includes the channel, <masterChan>, and at least one channel
     * from each of the slave modules.
     */
    error = e1432_set_trigger_master( hw, masterChan, 
					E1432_TRIGGER_MASTER_ON );
    if( error ) return error;

	......

    do	/* wait for trigger from master */
    {
        error = e1432_read_register( hw, masterChan, 	
				E1432_IRQ_STATUS2_REG, &status );
        if( error ) return error;
    }while( ( status & E1432_IRQ_TRIGGER ) == 0 ); 

    error = e1432_send_trigger( hw, groupID );
    if( error ) return error;
.cE
.SH "RESET VALUE"
Not applicable.
.SH "RETURN VALUE"
Returns 0 if successful, a (negative) error number otherwise.  The error,
\fBERR1432_NO_GROUP\fR, will be returned if \fIID\fR is not a group ID.
\fBERR1432_NO_CHANNEL\fR will be returned if a trigger master has not 
been set for the group, \fIID\fR.
.SH "SEE ALSO"
.na
e1432_set_trigger_master, e1432_set_data_mode
.ad
